package com.hz.service.impl;

import com.hz.dao.AdminDao;
import com.hz.dao.SfAdminDao;
import com.hz.dao.UserDao;
import com.hz.pojo.Admin;
import com.hz.pojo.User;
import com.hz.service.AdminService;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Resource
    AdminDao adminDao;

    @Override
    public Admin logAdmin(String admin_name, String admin_password) throws Exception {
        return adminDao.logAdmin(admin_name,admin_password);
    }

    @Override
    public Admin getAdmin(String admin_id) throws Exception {
        return adminDao.getAdmin(admin_id);
    }

    @Override
    public int addAdmin(Admin admin) throws Exception {
        return adminDao.addAdmin(admin);
    }

    @Override
    public int delAdmin(String admin_id) throws Exception {
        return adminDao.delAdmin(admin_id);
    }

    @Override
    public int updAdmin(Admin admin) throws Exception {
        return adminDao.updAdmin(admin);
    }

    @Override
    public List<Admin> selAdmin() throws Exception {
        return adminDao.selAdmin();
    }

    @Override
    public List<User> selUser(Integer pages,Integer pageSize,String inquire) throws Exception {
        return adminDao.selUser(pages,pageSize,inquire);
    }

    @Override
    public int udpUserProxyId(int proxy_id, String open_id) throws Exception {
        return adminDao.udpUserProxyId(proxy_id,open_id);
    }
    @Override
    public int getUserCounts(String inquire) throws Exception {
        return adminDao.getUserCounts(inquire);
    }
}
